import { defineStore } from "pinia"

let users = defineStore('users', {
    state() {
        return {
            name: '高启强',
            userInfo: {},
            permission:[]
        }
    },
    actions: {
        setUserInfo(payload) {
            this.userInfo = payload;
        }
    },
    //缓存到本地
    persist: {
        //缓存哪个字段
        paths: ['userInfo','permission']
    }
})


export default users;